<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>旋转中心点案例</title>
  <style>
    .box {
      position: relative;
      width: 400px;
      height: 400px;
      border: 1px solid #000;
    }

    .son {
      position: absolute;
      top: 50%;
      left: 50%;
      /* 居中 */
      transform: translate(-50%, -50%);
      width: 100px;
      height: 100px;
      background-color: silver;
      overflow: hidden;
    }

    .son::before {
      content: "Hello";
      display: block;
      width: 100%;
      height: 100%;
      background-color: pink;
      /* 1. 设置旋转中心点为左下 */
      transform-origin: left bottom;

      /* 2. 旋转 */
      transform: rotate(90deg);
      transition: all 1s;
      text-align: center;
      line-height: 100px;
      font-size: 18px;
      font-weight: 700;
    }

    .son:hover::before {
      font-size: 25px;
      transform: rotate(0deg);
    }
  </style>
</head>

<body>

  <div class="box">
    <div class="son">
    </div>
  </div>


</body>

</html>